﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.IO;
using System.Windows.Forms;

namespace GotLyrics.UnitTest
{
    [SetUpFixture]
    public class TestCommon
    {
        [SetUp]
        public void Init()
        {
            _mp3RootDir = Settings.Default.Mp3RootDir;

            Assert.IsTrue(Directory.Exists(_mp3RootDir), "Cannot open the directory \"" + _mp3RootDir + "\". Check test settings.");

            Assert.IsTrue(File.Exists(Settings.Default.Mp3TestFile), "Cannot find the file \"" + Settings.Default.Mp3TestFile + "\". Check test settings.");
            
        }

        [TearDown]
        public void Unload()
        {

        }

        private static string _mp3RootDir;
        public static string Mp3RootDir
        {
            get { return _mp3RootDir; }
        }

        private static LyricGrabberContext _context;
        /// <summary>
        /// Gets the context.
        /// </summary>
        /// <value>The context.</value>
        public static LyricGrabberContext Context
        {
            get
            {
                if (_context == null)
                {
                    _context = new LyricGrabberContext(Settings.Default.Mp3TestFile);
                }

                return _context;
            }
        }
    }
}
